<?php 
	
	// ** Admin Settings ** //
     $settings = AdminSettings::first();
	 
	$trueProfile = true; 

?>

<?php $__env->startSection('title'); ?><?php echo Lang::get('users.lists'); ?> - <?php echo e( $user->name ); ?> - <?php $__env->stopSection(); ?>

 <?php echo $__env->make('includes.cover-static', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

<?php $__env->startSection('content'); ?> 

<!-- Col MD -->
<div class="col-md-8">	

<?php if( Auth::check() && Auth::user()->id == $user->id ): ?>
<!-- ***** Modal ****** -->
	<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	  <div class="modal-dialog">
	    <div class="modal-content">
	      <div class="modal-header">
	        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
	        <h4 class="modal-title text-left" id="myModalLabel"><strong><?php echo Lang::get('users.create_list'); ?></strong></h4>
	      </div>
	      
	      <div class="modal-body">
	      	
	     <form class="form-horizontal" id="form-edit-shot" method="post" role="form" action="<?php echo URL::to('/'); ?>/lists/add">
			 
			 <div class="form-group <?php if( $errors->first('name') ): ?> has-error <?php endif; ?>">
			    <label for="inputEmail3" class="col-sm-2 control-label input-sm"><?php echo Lang::get('users.name'); ?></label>
			    <div class="col-sm-10">
			      <input type="text" value="" name="name" class="form-control input-sm" id="title" placeholder="<?php echo Lang::get('users.name'); ?>">
	     			
	     		<?php if( $errors->first("name") ): ?>    	
			<div class="alert alert-danger btn-sm errors-account" role="alert">
	            	<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
	            		<strong><?php echo $errors->first("name"); ?></strong>
	     	</div><!-- Error -->
	     	<?php endif; ?>
	     	
			    </div>
			  </div><!-- **** form-group **** -->
			
			 <div class="form-group <?php if( $errors->first('project') ): ?> has-error <?php endif; ?>">
			    <label for="inputEmail3" class="col-sm-2 control-label input-sm"><?php echo Lang::get('misc.type'); ?></label>
			    <div class="col-sm-10">
			    	
			    	<select id="project" name="type" class="input-sm btn-block">
					  <option value="1"><?php echo Lang::get('misc.public'); ?></option>
					  	<option value="0"><?php echo Lang::get('misc.private'); ?></option>
					</select>

			    </div>
			  </div><!-- **** form-group **** -->
			    
			  <div class="form-group <?php if( $errors->first('description') ): ?> has-error <?php endif; ?>">
			    <label class="col-sm-2 control-label input-sm"><?php echo Lang::get('misc.description'); ?> (<?php echo Lang::get('misc.optional'); ?>)</label>
			    <div class="col-sm-10">
			      <textarea name="description" rows="4" id="description" class="form-control input-sm textarea-textx"></textarea>
	             
	             <?php if( $errors->first("description") ): ?>    	
			<div class="alert alert-danger btn-sm errors-account" role="alert">
	            	<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
	            		<strong><?php echo $errors->first("description"); ?></strong>
	     	</div><!-- Error -->
	     	<?php endif; ?>
	     	
			    </div>
			  </div><!-- **** form-group **** -->
			  			  
			  <div class="form-group">
			    <div class="col-sm-offset-2 col-sm-10">
			      <button style="padding: 9px 30px;" type="submit" class="btn btn-info btn-sm btn-sort" id="addLists">
			      	<?php echo Lang::get('users.create'); ?>

			      	</button>
			    </div>
			  </div><!-- **** form-group **** -->
			  
			</form><!-- **** form **** -->
			    
	      </div><!-- modal-body -->
	    </div>
	  </div>
	</div> <!-- ***** Modal ****** -->
	<?php endif; ?>
			
<?php if( $totalGlobal != 0 ): ?>
	
	<h1 class="title-item none-overflow">
	<?php echo Lang::get('users.lists'); ?> <small>(<?php echo Helper::formatNumber( $totalGlobal ); ?>)</small>

	<?php if( Auth::check() && Auth::user()->id == $user->id ): ?>
		<button type="button" data-toggle="modal" data-target="#myModal" class="btn btn-sm btn-success pull-right">
			<i class="glyphicon glyphicon-plus myicon-right"></i> <?php echo Lang::get('users.create_list'); ?>

			</button>
	<?php endif; ?>
	</h1> 
<hr />
	
	
	<?php foreach( $data as $lists ): ?>
	
	<?php
	
	if( Str::slug( $lists->name ) == '' ) {
	
		$slugUrl  = '';
	} else {
		$slugUrl  = '-'.Str::slug( $lists->name );
	}
	
	$slugUrlLists = URL::to('@').$lists->user()->username.'/lists/'.$lists->id.$slugUrl;
	 ?>
	 
<div class="media media-designer">
    		<span class="pull-left">
    			<a class="image-thumb" title="<?php echo e( $lists->user()->name ); ?>" href="<?php echo URL::to('@'); ?><?php echo $lists->user()->username; ?>">
    			<img width="45" height="45" class="media-object img-circle" src="<?php echo URL::asset('public/avatar'); ?>/<?php echo $lists->user()->avatar; ?>">
    			</a>
    		</span>
    		<div class="media-body">
    			<div class="pull-left">
    				<h4 class="media-heading">
    				<a class="link-user-profile" title="<?php echo e( $lists->name ); ?>" href="<?php echo $slugUrlLists; ?>">
    					<?php echo e( $lists->name ); ?>

    					</a> 
    					
    					<?php if( $lists->type == 0 ): ?>
    					<small>
    						<i class="icon-lock" title="<?php echo Lang::get('misc.private'); ?>"></i>
    					</small>
    					<?php endif; ?>
    			</h4>
    			 <!-- List group -->
    	<ul class="list-group list-designer">
    		<li><?php echo Lang::get('misc.by'); ?> 
    			<a class="links-ds" href="<?php echo URL::to('@'); ?><?php echo $lists->user()->username; ?>"><?php echo e( $lists->user()->name ); ?></a>
    			
    			// <a class="links-ds" href="<?php echo $slugUrlLists; ?>/members">
    			 			<strong><?php echo $lists->users()->count(); ?></strong> <?php echo Lang::choice('users.members',$lists->users()->count()); ?>

    			 			</a>
    			</li>
    			 </ul>
    			</div><!-- /End Pull Left -->
    			
     <?php if( $lists->users()->count() != 0 ): ?> 	
	  <ul class="pull-right cover-img-desing list-inline" style="margin: 10px;">
	   <!-- Start List -->
	   <?php foreach( $lists->users()->take(5)->get() as $userlist ): ?>
	   <li>		    			
	    <a class="image-thumb"  href="<?php echo URL::to('@'); ?><?php echo $userlist->user()->username; ?>">
	    			<img width="30" class="media-object img-circle showTooltip" data-toggle="tooltip" data-placement="left" title="<?php echo $userlist->user()->name; ?>" src="<?php echo URL::asset('public/avatar'); ?>/<?php echo $userlist->user()->avatar; ?>">
	    			</a>
	   </li><!-- End List -->
	   <?php endforeach; ?>
	    	</ul>
	    	<?php endif; ?>
	    	
  </div><!-- /End Media Body -->
</div><!-- Media Designer -->
<?php endforeach; ?>


<?php if( $data->getTotal() != $data->count() ): ?>
         	   
  <div class="btn-group paginator-style">
		   <?php echo $data->links(); ?> 
		</div>
		
<?php endif; ?>

				  	
	<?php else: ?>
	
	<?php if( Auth::check() && $user->id != Auth::user()->id || !Auth::check() ): ?>
	
	<div class="btn-block text-center">
	    	<i class="icon-list ico-no-result"></i>
	    </div>
	    
	<h3 class="margin-top-none text-center no-result user-no-result">
	    	- <strong><?php echo $user->name; ?></strong> <?php echo Lang::get('users.no_list'); ?> -
	    	</h3>
	    	
	    <?php elseif(Auth::check() && $user->id == Auth::user()->id): ?>	
	 
		<div class="btn-block text-center">
	    	<i class="icon-list ico-no-result"></i>
	    </div>
	    
	    <h3 class="margin-top-none text-center no-result user-no-result">
	    	- <?php echo Lang::get('users.session_no_list'); ?> -
	    	</h3>	
	    	
 
	   <div class="btn-block text-center" style="margin-bottom: 20px;">
	   	<button type="button" data-toggle="modal" data-target="#myModal" class="btn btn-sm btn-success">
			<i class="glyphicon glyphicon-plus myicon-right"></i> <?php echo Lang::get('users.create_list'); ?>

			</button>
	   </div> 
		<?php endif; ?>
	
	
	<?php endif; ?>
</div><!-- /COL MD -->
<?php $__env->stopSection(); ?>

<?php $__env->startSection('sidebar'); ?>
	<div class="col-md-4">
		<?php echo $__env->make('includes.ads', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
	</div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('javascript'); ?>
<script type="text/javascript">

<?php if(Session::has('success_add')): ?>
	 $('.popout').html("<?php echo Session::get('success_add'); ?>").fadeIn(500).delay(5000).fadeOut();
   <?php endif; ?>
   
   <?php if( Session::has('error_add') ): ?>
   	$('#myModal').modal('show');
   <?php endif; ?>

$("#addLists").on('click',function(){
    	$(this).css({'display': 'none'})
    });
    
	$("#description").charCount({ allowed: <?php echo $settings->message_length; ?>, warning: 10, css: 'counterBio' });

</script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>